#include "SCI_HAL_QG.h"

void vfnSCI_SetBaudRate (uint16 u16baudrate)
{
    SCIBD = u16baudrate;
}

void vfnSCI_Init (void)
{
    SCIC1 = SCI_CONTROL_REG1;
    SCIC2 = SCI_CONTROL_REG2;
    SCIC3 = 0x00;  
}

void vfnSCI_SendByte (uint8 u8data)
{
    SCID = u8data;
}

uint8 u8SCI_TxBufferEmpty (void)
{
    return SCIS1_TDRE;
}

uint8 u8SCI_TxComplete (void)
{
    return SCIS1_TC;
}

uint8 u8SCI_RxRegisterFull (void)
{
    return SCIS1_RDRF;
}

uint8 u8SCI_CheckOverrun (void)
{
    return SCIS1_OR;
}

uint8 u8SCI_ReadByte (void)
{
    return SCID;
}

uint8 u8SCI_RxPending (void)
{
    return SCIS1_RDRF;
}

void vfnSCI_DisableRxInt (void)
{
	SCIC2_RIE = 0;
}

void vfnSCI_EnableRxInt (void)
{
	SCIC2_RIE = 1;
}


